//公共方法,变量
var URL="http://admin.api.test.51bbc.cn/index/index/index";
var timesTamp = Math.round(new Date().getTime()/1000),noNce = randomString(5),appkey = '2ef161ba0bd02b6c4c399826d941eb804ad8376d',
signaTure = sha1(timesTamp + noNce + appkey),storage = window.localStorage,Token=storage.getItem("token");
function randomString(len) {　　
    len = len || 32;　　
    var $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';　　
    var maxPos = $chars.length;　　
    var pwd = '';　　
    for (i = 0; i < len; i++) {
        //0~32的整数  
        pwd += $chars.charAt(Math.floor(Math.random() * (maxPos + 1)));　　
    }　　
    return pwd;
}
function get_Data(){
$.get("http://admin.api.test.51bbc.cn/index/index/index",{token:Token,signature:signaTure,nonce:noNce,timestamp:timesTamp},function(res){
    console.log(JSON.parse(res));
    var data=JSON.parse(res);
    if(data.code==200){
        // 今日新单
        $(".data_new p").text(data.data.dayNum);
        $(".data_counts p").text(data.data.num);
        $(".data_new_tj p").text(data.data.dtjNum);
        $(".data_count_cs p").text(data.data.dcsNum);
        $(".data_count_zs p").text(data.data.dzsNum);
    }
})
}
get_Data();
